package com.kehutong.charge.util;

import org.coraframework.logger.Logger;
import org.coraframework.logger.LoggerFactory;
import org.coraframework.util.Ioc;
import com.coraframework.quartz.Job;
import com.coraframework.quartz.JobExecutionContext;
import com.coraframework.quartz.JobExecutionException;
import com.kehutong.charge.service.ChargeUrgingService;

/**
 *  催缴定时任务
 */
public class ChargeUrgingJob implements Job {

    private static final Logger logger = LoggerFactory.getLogger(ChargeUrgingJob.class);

    private ChargeUrgingService chargeUrgingService;

    public ChargeUrgingJob() {
        this.chargeUrgingService = Ioc.getInstance(ChargeUrgingService.class);
    }

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        try {
            logger.info("执行催缴订单定时任务开始！");

            chargeUrgingService.chargeUrgingTask();
        } catch (Exception e) {
            logger.error("执行催缴定时任务开始！", e);
        }
    }
}
